package com.sanley.piss.mapper;


import com.sanley.piss.model.BaseMapper;
import com.sanley.piss.model.po.UserAndRoleRelation;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.io.Serializable;

/**
 * Create By  on 2021/3/8.
 * @author 张凯大天才
 */
@Mapper
public interface UserAndRoleRelationMapper extends BaseMapper<UserAndRoleRelation> {
    /**
     * 删除单挑数据
     * @param id
     */
    void deleteById(Serializable id);

    /**
     * 查询被关联roleID的数量 用于判断删除
     * @param roleId
     * @return
     */
    @Select("select count(role_id) from t_system_user_role_relation where role_id=#{roleId}")
    long selectCountByRoleId(Serializable roleId);
}
